package com.tsd.core.config.excel;

import cn.afterturn.easypoi.cache.manager.IFileLoader;
import com.tsd.core.utils.FileUtil;
import com.tsd.core.utils.HlpUtils;

/**
 * @ClassName: EasypoiFileLoader
 * @Description: TODO
 * @Author: Hillpool
 * @Date: 2021/1/27 12:10
 * @Version: 1.0
 */
public class EasypoiFileLoader implements IFileLoader {
    /**
     * 可以自定义KEY的作用
     *
     * @param key
     * @return
     */
    @Override
    public byte[] getFile(String key) {
        byte[] bytes = new byte[0];
        if (!HlpUtils.isEmpty(key)) {
            bytes = FileUtil.readBytes(key);
        }
        return bytes;
    }
}
